//
//  HMComposeButton.swift
//  WeiBoXR
//
//  Created by acer on 16/9/30.
//  Copyright © 2016年 acer. All rights reserved.
//

import UIKit

class HMComposeButton: UIButton {

    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func setupUI() {
        titleLabel?.font = UIFont.systemFont(ofSize: 14)
        self .setTitleColor(UIColor.gray, for: .normal)
        titleLabel?.contentMode = .center
        titleLabel?.textAlignment = .center
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        imageView?.width = width
        imageView?.height = width
        imageView?.y = 0
        imageView?.x = 0
        titleLabel?.width = width
        titleLabel?.height = height - width
        titleLabel?.x = 0
        titleLabel?.y = width
    }
    //  使用pop动画需要把isHighlighted改成false
     override var isHighlighted: Bool {
        get {
            return false
        } set {
            
        }
    }
}
